//////////////////////////////////////////ok
#include"stdafx.h"
#include "bochs.h"



void  
IA32_CPU::Resolve32Mod0Rm0(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EAX;
}
  void  
IA32_CPU::Resolve32Mod0Rm1(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = ECX;
}
  void  
IA32_CPU::Resolve32Mod0Rm2(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EDX;
}
  void  
IA32_CPU::Resolve32Mod0Rm3(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EBX;
}
  void  
IA32_CPU::Resolve32Mod0Rm5(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod0Rm6(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = ESI;
}
  void  
IA32_CPU::Resolve32Mod0Rm7(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EDI;
}


  void  
IA32_CPU::Resolve32Mod1or2Rm0(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EAX + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Rm1(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = ECX + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Rm2(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EDX + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Rm3(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EBX + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Rm5(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EBP + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Rm6(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = ESI + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Rm7(Ia32_Instruction_c *i)
{
  IA32_RMAddr(i) = EDI + i->displ32u();
}


  void  
IA32_CPU::Resolve32Mod0Base0(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EAX + scaled_index;
}
  void  
IA32_CPU::Resolve32Mod0Base1(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = ECX + scaled_index;
}
  void  
IA32_CPU::Resolve32Mod0Base2(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EDX + scaled_index;
}
  void  
IA32_CPU::Resolve32Mod0Base3(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EBX + scaled_index;
}
  void  
IA32_CPU::Resolve32Mod0Base4(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = ESP + scaled_index;
}
  void  
IA32_CPU::Resolve32Mod0Base5(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = i->displ32u() + scaled_index;
}
  void  
IA32_CPU::Resolve32Mod0Base6(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = ESI + scaled_index;
}
  void  
IA32_CPU::Resolve32Mod0Base7(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EDI + scaled_index;
}




  void  
IA32_CPU::Resolve32Mod1or2Base0(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EAX + scaled_index + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Base1(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = ECX + scaled_index + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Base2(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EDX + scaled_index + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Base3(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EBX + scaled_index + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Base4(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = ESP + scaled_index + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Base5(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EBP + scaled_index + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Base6(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = ESI + scaled_index + i->displ32u();
}
  void  
IA32_CPU::Resolve32Mod1or2Base7(Ia32_Instruction_c *i)
{
  Bit32u scaled_index;

  if (i->sibIndex() != 4)
    scaled_index = IA32_READ_32BIT_REG(i->sibIndex()) << i->sibScale();
  else
    scaled_index = 0;
  IA32_RMAddr(i) = EDI + scaled_index + i->displ32u();
}
